<template>

    <a-modal title="成果信息" v-model="showModal" :mask-closable="false" :width="1000" :footer="null">
        <a-row>
            <a-col span="24">
                <a-tag color="#189583"
                       style="font-size: 18px; padding: 5px 10px; border-radius: 10px; background: linear-gradient(93.32deg, rgba(25,151,133,1) 2.78%,rgba(84,211,170,1) 97.62%)">
                    <div><span>{{ getFruitTypeName(fruitDataObj.fruitType) }}</span></div>
                </a-tag>
            </a-col>
        </a-row>
        <a-row style="margin-top: 5px;">
            <a-col span="24">
                <div class="ft">
                    <span v-html="fruitDataObj.fruitName"></span>
                </div>
            </a-col>
        </a-row>
        <!--    <a-row style="margin-top: 5px;">-->
        <!--      <a-col span="24">-->
        <!--        <div style="display: inline-block; color: #189583; padding-right: 10px; font-size: 15px; font-weight: bold;">{{fruitDataObj.researchField == null ? fruitDataObj.field : fruitDataObj.researchField}}</div>-->
        <!--        <div style="display: inline-block; font-size: 15px; padding-left: 30px;">{{fruitDataObj.orgName}}</div>-->
        <!--      </a-col>-->
        <!--    </a-row>-->
        <a-row style="margin-top: 5px;">
            <a-col span="20">
                <div style="font-size: 15px; ">
                    <div v-if="fruitDataObj.tagList">
                            <span v-for="(tagGroup, index) in fruitDataObj.tagList"
                                  :key="index">
                              <span
                                  v-if="tagGroup.tagTypeName === 'fruit_author_names'">
                                <span v-for="(author, idx) in tagGroup.tagNameList"
                                      :key="idx">
                                  {{ author.tagName }}
                                  <span
                                      v-if="idx < tagGroup.tagNameList.length - 1">, </span>
                                </span>
                              </span>
                            </span>
                    </div>
                </div>
                <div style="font-size: 15px;">{{ fruitDataObj.orgName }}</div>
            </a-col>
        </a-row>
        <a-row style="margin-top: 5px;">
            <a-col span="24">
                <div style="font-size: 18px">
                    {{ fruitDataObj.fruitPubTime != null ? fruitDataObj.fruitPubTime.substring(0, 10) : "" }}
                </div>
            </a-col>
        </a-row>
        <a-row style="margin-top: 5px;" v-if="fruitDataObj.fruitSummary != null && fruitDataObj.fruitSummary != ''">
            <a-col span="24">
                <div
                    style="font-size: 18px; background-color: #189583; border-radius: 10px; padding: 10px; color: #fff; line-height: 30px;">
                    {{ fruitDataObj.fruitSummary }}
                </div>
            </a-col>
        </a-row>
    </a-modal>
</template>

<script>

import {commonPostAction} from "@/api/esManage";
import {getFruitTypeName} from '@/utils/tools'

export default {
    name: 'FruitInfo',
    data() {
        return {
            showModal: false,
            fruitDataObj: {}
        }
    },
    computed: {},
    created() {
    },
    methods: {
        getFruitTypeName,
        showModalInfo(fruitDataObj) {
            this.showModal = true;
            this.fruitDataObj = fruitDataObj;
            this.addSearchContentLog(fruitDataObj);
        },
        addSearchContentLog(obj) {
            let url = "/operationLog/addViewFruitLog";
            let entityObj = {
                "fruitId": obj.fruitId,
                "fruitType": obj.type,
                "fruitName": obj.fruitName,
                "fruitField": obj.researchField,
                "fruitAuthorName": obj.fruitAuthorName,
                "fruitOrgName": obj.orgName,
                "pubTime": obj.fruitPubTime,
                "summary": obj.fruitSummary
            }
            commonPostAction(url, entityObj).then(res => {
                if (res.data.success) {
                }
            }).catch(err => {
                console.log(err)
            })
        },
    }
}
</script>
<style scoped>

.ft {
    font-weight: bold;
    font-size: 20px;
}

</style>